import request from '@/utils/request'

export default {
  /**
   * 分页查询
   * @param data
   */
  init(data) {
    return request({
      url: `/tms-work/task-pickup-dispatch/page`,
      method: 'post',
      data: data
    })
  },
  /**
   * 查找机构下对应的快递员信息
   * @param coreOrgId
   * @returns {AxiosPromise}
   */
  findGlobalUserByCoreOrgId(coreOrgId) {
    return request({
      url: `/tms-work/task-pickup-dispatch/findGlobalUserByCoreOrgId/${coreOrgId}`,
      method: 'get'
    })
  },
  /**
   * 人工分配快递员
   * @param taskPickUpDispatchId 取派件任务Id
   * @param courierId 快递员Id
   * @returns {AxiosPromise}
   */
  courierAssignment(taskPickUpDispatchId, courierId) {
    return request({
      url: `/tms-work/task-pickup-dispatch/courierAssignment/${taskPickUpDispatchId}/${courierId}`,
      method: 'put'
    })
  }
}
